<!-- 菜单递归渲染 -->

<template id="my-submenu">
    <el-submenu :index="menuData.id" :popper-append-to-body="false">
        <template slot="title">{{menuData.title}}</template>
        <template v-for="item in menuData.children">
            <my-com v-if="item.children" :menu-Data="item"></my-com>
            <el-menu-item v-else :index="item.id">{{item.title}}</el-menu-item>
        </template>
    </el-submenu>
</template>

<script comjs>
    Vue.component("my-com", {
        props: {
            menuData: {},
        },
        template: "#my-submenu",
    });
</script>